
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="btn-group hidden-xs" id="toolbar" role="group">
			<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="module:cloudPe:add">
				<i class="fa fa-plus"></i> 新增
			</a>
			<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="module:cloudPe:remove">
				<i class="fa fa-trash-o"></i> 删除
			</a>
		</div>
			
		<div class="col-sm-12 select-info order-table">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
		
		
		
		

    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permissionService.hasPermi('module:cloudPe:edit')}]];
        var removeFlag = [[${@permissionService.hasPermi('module:cloudPe:remove')}]];
        var prefix = ctx + "module/cloudPe"

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
               // updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                modalName: "PE管理",
                search: false,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'peId', 
					title : 'ID' 
				},
				{
					field : 'peName', 
					title : '名称' 
				},
				{
					field : 'ip', 
					title : '本地环回地址' 
				},
				{
					field : 'pop', 
					title : 'Pop点' 
				},
				{
					field : 'deviceModel', 
					title : '设备型号' 
				},
				{
					field : 'deviceCity', 
					title : '设备城市' 
				},
		        {
		            field: 'status',
		            title: '状态',
		            align: "center",
		            formatter: function(item, index) {
		                if (item.status == '0') {
		                    return '<span class="badge badge-primary">正常</span>';
		                } else if (item.status == '1') {
		                    return '<span class="badge badge-danger">停用</span>';
		                }
		            }
		        },
				{
					field : 'remark', 
					title : '备注' 
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	//actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.peId + '\')"><i class="fa fa-edit"></i>配置CPE</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.peId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>